package com.echat.business.home.service.impl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.echat.business.home.dao.SysThirdUserMapper;
import com.echat.business.home.model.SysThirdUser;
import com.echat.business.home.service.ISysThirdUserService;
import com.echat.core.constant.ConstantUtils;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author chentl123
 * @since 2019-05-28
 */
@Service
public class SysThirdUserServiceImpl extends ServiceImpl<SysThirdUserMapper, SysThirdUser> implements ISysThirdUserService {


    @Override
    public int selectCountByThirdId(Integer thirdId) {
        Wrapper<SysThirdUser> wrapper = new EntityWrapper<>();
        wrapper.eq(ConstantUtils.Public.THIRD_ID, thirdId);
        return selectCount(wrapper);
    }

    @Override
    public SysThirdUser selectByUserName(String username) {
        Wrapper<SysThirdUser> wrapper = new EntityWrapper<>();
        wrapper.eq("login", username);
        return selectOne(wrapper);
    }
}
